package file1;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
public class Inputw {
	public static void main(String[] args) {
		File a = new File("d:\\测试.txt");
		File b = new File("d:\\java.txt");
		

		try {
			InputStreamReader a1 = new InputStreamReader(new FileInputStream(a), "UTF-8");
			OutputStreamWriter b1=new OutputStreamWriter(new FileOutputStream(b), "UTF-8");
			
			int c = 0;
			c = a1.read();
			while (c != -1){
				c = a1.read();
				System.err.print((char) c);
				b1.write(c);
			}
			a1.close();b1.flush();b1.close();
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}

}
